home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 February / EnterCD 02_2005.iso / Multimedia / Microsoft Winter Fun Pack 2004 / WinterFunPack2004forWindowsXP.msi / Binary.Callwhitecap_471_he1 / $R0 / Boot.txt < prev    next >
Encoding:
Text File  |  2004-11-29  |  13.8 KB  |  376 lines

  1.  
  2.  
  3.  
  4. /*
  5.     To avoid maintaining two copies of documentation, common docs for the "boot.txt" file are in G-Force's boot.txt file.
  6. */
  7.  
  8.  
  9.  
  10.  
  11. #if _VERSION_ != 471
  12.     print( "Warning: the expected version in boot.txt doesn't match the actual version.\n" );
  13. #endif
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. #include "includes/common.txt"
  21.  
  22.  
  23. #define    SS_PREFS_VERSION        471
  24.  
  25. // WhiteCap specific prefs...
  26. #define        PREF_CONFIG_INTERVAL            'CInt'
  27. #define        PREF_CONFIG_MORPH_DURATION        'CMor'
  28. #define        PREF_CONFIG_TRANSITION_FCN        'CTrn'
  29.  
  30.  
  31.  
  32.  
  33. // If the prefs file is missing or outdated, set "factory" settings.
  34. if ( GetPref( PREF_PREFS_VERSION ) != SS_PREFS_VERSION ) {
  35.  
  36.     SetPref( PREF_PREFS_VERSION, SS_PREFS_VERSION );
  37.  
  38.     SetPref( PREF_FFT_FADE_AWAY, .6 );
  39.     SetPref( PREF_FFT_NUM_BINS, 59 );
  40.     SetPref( PREF_FFT_SMOOTH, .015 );
  41.     SetPref( PREF_RESPONSE_SCALE, 1.0 );
  42.     SetPref( PREF_PREAMP_SCALE, 1.0 );
  43.     SetPref( PREF_FULLSCREEN_DEVICE, SS_HOST_DISPLAY_DEVICE );
  44.     SetPref( PREF_FULLSCREEN_DEPTH, GetRecommendedFullscreenDepth() );
  45.     SetPref( PREF_FULLSCREEN_X, 640 );
  46.     SetPref( PREF_FULLSCREEN_Y, 480 );
  47.     SetPref( PREF_MAX_SIZE_X, 10000 );
  48.     SetPref( PREF_MAX_SIZE_Y, 10000 );
  49.     SetPref( PREF_PIXEL_DOUBLING, false );
  50.     SetPref( PREF_FORCE_MULTIBLT, false );
  51.     SetPref( PREF_BORDERLESS_WINDOW, false );
  52.     SetPref( PREF_FLOATING_WINDOW, false );
  53.     SetPref( PREF_MAX_COVER_ART_X, 220 );
  54.     SetPref( PREF_MAX_COVER_ART_Y, 220 );
  55.     SetPref( PREF_DESIRED_FRAME_RATE, 40 );        // WhiteCap looks best at 30-40 FPS
  56.     SetPref( PREF_LINE_BOOST, 1 );
  57.     SetPref( PREF_TEXT_FONT, GetSystemFontName() );
  58.     SetPref( PREF_TEXT_SIZE, 18 );
  59.     SetPref( PREF_CHECK_FOR_UPDATES, 7 );
  60.     SetPref( PREF_NETWORK_MODE, 1 );
  61.  
  62.  
  63.     // By default, ask the plugin host for the sound data to visualize.
  64.     SetPref( PREF_AUDIO_INPUT_SOURCE, SS_HOST_AUDIO_DEVICE );
  65.  
  66.     SetPref( PREF_TRACK_TEXT_AUTO , true );
  67.     SetPref( PREF_TRACK_TEXT_DURATION, 14 );
  68.  
  69.     SetPref( PREF_AUDIO_INPUT_SOURCE, 0 );
  70.  
  71.     // WhiteCap specific prefs...
  72.     SetPref( PREF_CONFIG_INTERVAL, "12 + rnd( 20 )" );
  73.     SetPref( PREF_CONFIG_MORPH_DURATION, "15 + rnd( 10 )" );
  74.     SetPref( PREF_CONFIG_TRANSITION_FCN, "i^2.1" );
  75.  
  76.  
  77.     #if ITUNES
  78.         SetPref( PREF_FFT_BIN_START, 8 );
  79.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  80.         //SetPref( PREF_FFT_MAP_FCN, ".6 * atan( .00008 * x ^ 1.8 )" );           // 08 Nov 03 - ACO
  81.         //SetPref( PREF_FFT_MAP_FCN, ".35 * atan( .00007*(1+.15 * w) * x ^ 2.0 )" );     // 11 Nov 03 - ACO (FFde=.6)
  82.         //SetPref( PREF_FFT_MAP_FCN, ".25 * atan( .0007*(1+.15 * w) * x ^ 1.6 )" );     // 15 Nov 03 - ACO (FFde=.7)
  83.         //SetPref( PREF_FFT_MAP_FCN, ".26 * atan( .0003*(1+.15 * w) * x ^ 1.7 )" );     // 31 Mar 04 - ACO (FFde=.6)
  84.         SetPref( PREF_FFT_MAP_FCN, ".25 * atan( .0005*(1+.15 * w) * x ^ 1.8 )" );    // 4.6.1
  85.     #elif SONIQUE || XMPLAY
  86.         SetPref( PREF_FFT_BIN_START, 32 );
  87.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  88.         SetPref( PREF_FFT_MAP_FCN, ".5 * atan( .014 * ( 1 + .3 * w ) * x ^ 1.5 )" );
  89.     #elif SOUNDJAM || AUDION
  90.         SetPref( PREF_FFT_BIN_START, 4 );
  91.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  92.         SetPref( PREF_FFT_MAP_FCN, ".6 * atan( .00004 * x ^ 1.7 )" );
  93.     #elif WMP
  94.         SetPref( PREF_FFT_BIN_START, 24 );
  95.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  96.         SetPref( PREF_FFT_FADE_AWAY, .5 );
  97.         //SetPref( PREF_FFT_MAP_FCN, "2.4 * atan( ( .0045 * (pos(x-85) + .2 * x ) )^1.5)" );
  98.         SetPref( PREF_FFT_MAP_FCN, ".7 * atan( ( .019 * pos( x - 40 ) + .003 * pos( x - 20 ) ) )" );    // 4.6.1
  99.     #elif JMC
  100.         SetPref( PREF_FFT_BIN_START, 24 );
  101.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  102.         SetPref( PREF_FFT_FADE_AWAY, .5 );
  103.         SetPref( PREF_FFT_MAP_FCN, ".5 * atan(.0003 * ( .5 + w ) * x ^ 1.7 )" );    // 4 Jun 04
  104.     #elif WINAMP
  105.         SetPref( PREF_FFT_BIN_START, 28 );
  106.         SetPref( PREF_FFT_BIN_RANGE, 1 );
  107.         SetPref( PREF_FFT_FADE_AWAY, .45 );
  108.         //SetPref( PREF_FFT_MAP_FCN, ".45 * atan( .004 * x ^ 1.5 )" );
  109.         SetPref( PREF_FFT_MAP_FCN, ".33 * atan( .0015 * x ^ 1.7 )" );            // 15 Nov 03 - ACO
  110.     #elif JETAUDIO || MEDIAMONKEY
  111.         SetPref( PREF_FFT_BIN_START, 14 );
  112.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  113.         SetPref( PREF_FFT_FADE_AWAY, .45 );
  114.         SetPref( PREF_FFT_MAP_FCN, ".33 * atan( .0015 * x ^ 1.7 )" );            // 15 Nov 03 - ACO
  115.     #elif MUSICMATCH
  116.         SetPref( PREF_FFT_BIN_START, 14 );
  117.         SetPref( PREF_FFT_BIN_RANGE, 2 );
  118.         SetPref( PREF_FFT_FADE_AWAY, .45 );
  119.         //SetPref( PREF_FFT_MAP_FCN, ".000020 * ( pos( x-130 ) )^2.1" );        // 15 Nov 03 - ACO
  120.         SetPref( PREF_FFT_MAP_FCN, ".000016 * ( pos( x-130 ) )^2.1" );            // 4.6.1
  121.     #elif EXPORTER || STANDALONE || BAR || SCREENSAVER
  122.         SetPref( PREF_FFT_SMOOTH, 0.007 );
  123.         SetPref( PREF_FFT_FADE_AWAY, .4 );
  124.         SetPref( PREF_FFT_MAP_FCN, ".48 * atan( ( 9 * x * ( 2 + w ) ) ^ 1.5 )"  );
  125.     #endif
  126.  
  127.     #if STANDALONE || BAR || SCREENSAVER
  128.  
  129.         // For modes where there's no host, have the plugin try to take sound input from the system.
  130.         SetPref( PREF_AUDIO_INPUT_SOURCE, SS_BEST_VIS_AUDIO_DEVICE );
  131.     #endif
  132.  
  133.     // See comments in G-Force's boot file.
  134.     WritePrefs();
  135.  
  136. }
  137.  
  138.  
  139. SetVerboseMode( false );
  140.  
  141.  
  142. // We need to apply the stored track text font settings to the runtime environment...
  143. SetDefaultFont( GetPrefStr( PREF_TEXT_FONT ), GetPref( PREF_TEXT_SIZE ), SS_UTF8_CHARSET | SS_BOLD  );
  144.  
  145.  
  146.  
  147.  
  148.  
  149. #if ! _MACOS9_
  150.     BindEvent( SS_KEY_DOWN_EVENT | SS_SHIFT_KEY_CODE | 'C',    "            \
  151.         if ( GetPref( PREF_CHECK_FOR_UPDATES ) > 0 ) {                \
  152.             SetPref( PREF_CHECK_FOR_UPDATES, 0 );                \
  153.             print( \"Check for updates OFF\n\" ); }                \
  154.         else {                                    \
  155.             SetPref( PREF_CHECK_FOR_UPDATES, 7 );                \
  156.             print( \"Check for updates ON (set to every 7 days)\n\" );    \
  157.         }"
  158.     );        
  159. #endif
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. // ESC Key exits fullscreen
  168. BindEvent( SS_KEY_DOWN_EVENT | 27,                "SetFullscreen( false );" );
  169.  
  170. // RETURN or ENTER enters fullscreen mode
  171. BindEvent( SS_KEY_DOWN_EVENT | '\r',                "SetFullscreen( ! GetFullscreen() );" );
  172. BindEvent( SS_KEY_DOWN_EVENT | 3,                 "SetFullscreen( ! GetFullscreen() );" );
  173. BindEvent( SS_KEY_DOWN_EVENT | SS_SHIFT_KEY_CODE | '\r',    "SetFullscreen( ! GetFullscreen() );" );
  174.  
  175.  
  176. BindEvent( SS_KEY_DOWN_EVENT | 'L',     "printf( \"Current Config: %s\n\", GetCurrentConfig() );" );    
  177.  
  178.  
  179. BindEvent( SS_KEY_DOWN_EVENT | 'R',    "printf( \"fps=%f, load=%d, sleep=%d\n\", GetCurrentFPS(), GetCurrentLoad_MS(), GetPriority_MS() );" );
  180.  
  181.  
  182. #define _TOGGLE_PIXEL_DOUBLING     "     if ( SetPref( PREF_PIXEL_DOUBLING, ! GetPref( PREF_PIXEL_DOUBLING ) ) == ss_NoErr ) {        \
  183.                         if ( GetPref( PREF_PIXEL_DOUBLING ) ) {                            \
  184.                             print( \"Pixel doubling ON\n\" ); }                        \
  185.                         else {                                            \
  186.                             print( \"Pixel doubling OFF\n\" );                        \
  187.                         } }                                            \
  188.                     else {                                                \
  189.                         print( \"Pixel doubling is not supported for this media player.\n\" );            \
  190.                     }" );
  191.  
  192. BindEvent( SS_KEY_DOWN_EVENT | SS_SHIFT_KEY_CODE | 'D', _TOGGLE_PIXEL_DOUBLING );
  193.  
  194.  
  195. BindEvent( SS_KEY_DOWN_EVENT | 'U',     "                                        \
  196.                     SetSlideShow( false );                                \
  197.                     PurgeFileCache();                                  \
  198.                     SetConfig( GetCurrentConfig() );                        \
  199.                     print( \"File cache purged, current config recreated.\n\" );"
  200. );
  201.  
  202.  
  203. #define _CONFIG_QUICK_MORPH      1.4
  204. #define _DEFAULT_MORPH        -1
  205.  
  206. BindEvent( SS_KEY_DOWN_EVENT | '.',    "NextConfig( 1, _CONFIG_QUICK_MORPH, true );" );
  207. BindEvent( SS_KEY_DOWN_EVENT | ',',    "NextConfig( -1, _CONFIG_QUICK_MORPH, true );" );
  208.  
  209. #define _TURN_SLIDESHOW_ON    "    ShuffleSlideShow();                         \
  210.                     SetSlideShow( true );                         \
  211.                     print( \"Slideshow mode ON\n\" );"
  212.  
  213.  
  214. BindEvent( SS_KEY_DOWN_EVENT | 'G',     _TURN_SLIDESHOW_ON );
  215.  
  216. BindEvent( SS_KEY_DOWN_EVENT | 'F',     "SetSlideShow( false );                      \
  217.                     print( \"Slideshow mode OFF\n\"  );" );
  218.  
  219. BindEvent( SS_KEY_DOWN_EVENT | 'M',     "NextFullscreenResolution();                     \
  220.                     printf( \"New resolution: %dx%dx%d\", GetPref( PREF_FULLSCREEN_X ), GetPref( PREF_FULLSCREEN_Y ), GetPref( PREF_FULLSCREEN_DEPTH )  );        \
  221.                     if ( IsFullscreen() ) {                        \
  222.                         print( \" -- Reenter full screen mode for changes\" );    \
  223.                     }                                \
  224.                     print( \"\n\" );" );
  225.  
  226.  
  227. BindEvent( SS_KEY_DOWN_EVENT | 'M' | SS_SHIFT_KEY_CODE, "                    \
  228.         NextFullscreenDepth();                                 \
  229.         printf( \"New depth: %s\", GetPref( PREF_FULLSCREEN_DEPTH ) );            \
  230.         if ( GetPref( PREF_FULLSCREEN_DEPTH ) == GetRecommendedFullscreenDepth() ) {    \
  231.             print( \" (Recommended)\" );    }                    \
  232.         else {                                        \
  233.             print( \" (Not recommended)\" );                    \
  234.         }                                        \
  235.         if ( IsFullscreen() ) {                                \
  236.             print( \" -- Reenter full screen mode for changes\" );            \
  237.         }                                        \
  238.         print( \"\n\" );" );
  239.  
  240.  
  241.  
  242. BindEvent( SS_KEY_DOWN_EVENT | 'K' | SS_SHIFT_KEY_CODE,     "KillRunningScripts();" );
  243.  
  244. BindEvent( SS_KEY_DOWN_EVENT | '`',                 "Grab();" );
  245.  
  246. BindEvent( SS_KEY_DOWN_EVENT | 'H',                 "SetConsoleVisible( true );  Run( \"Help\" );" );
  247. BindEvent( SS_KEY_DOWN_EVENT | 'H' | SS_SHIFT_KEY_CODE,        "LaunchHelp();" );
  248.  
  249. BindEvent( SS_KEY_DOWN_EVENT | '\\',                "SetConsoleVisible( ! GetConsoleVisible() );" );
  250.  
  251. BindEvent( SS_KEY_DOWN_EVENT | '-',            "SetPref( PREF_RESPONSE_SCALE,    GetPref( PREF_RESPONSE_SCALE ) * .85 );  printf( \"Response scale: %f\n\", GetPref( PREF_RESPONSE_SCALE ) );" );
  252. BindEvent( SS_KEY_DOWN_EVENT | '=',            "SetPref( PREF_RESPONSE_SCALE,    GetPref( PREF_RESPONSE_SCALE ) / .85 );  printf( \"Response scale: %f\n\", GetPref( PREF_RESPONSE_SCALE ) );" );
  253. BindEvent( SS_KEY_DOWN_EVENT | '+',            "SetPref( PREF_RESPONSE_SCALE,    GetPref( PREF_RESPONSE_SCALE ) / .85 );  printf( \"Response scale: %f\n\", GetPref( PREF_RESPONSE_SCALE ) );" );
  254.  
  255. BindEvent( SS_KEY_DOWN_EVENT | '[',            "SetPref( PREF_PREAMP_SCALE,     GetPref( PREF_PREAMP_SCALE ) * .85 );  printf( \"Preamp scale: %f\n\", GetPref( PREF_PREAMP_SCALE ) );" );
  256. BindEvent( SS_KEY_DOWN_EVENT | ']',            "SetPref( PREF_PREAMP_SCALE,    GetPref( PREF_PREAMP_SCALE ) / .85 );  printf( \"Preamp scale: %f\n\", GetPref( PREF_PREAMP_SCALE ) );" );
  257.  
  258. #define _KILL_TRACK_TEXT        "KillOverlay( SS_OVERLAY_ID_TRACK_TEXT );            \
  259.                     KillOverlay( SS_OVERLAY_ID_TRACK_COVER_ART );"
  260.  
  261. #define _START_TRACK_TEXT        "StartTrackOverlay( GetPref( PREF_TRACK_TEXT_DURATION ), 3 );"
  262.  
  263.  
  264. BindEvent( SS_TRACK_BEGIN_EVENT, "                \
  265.     if ( GetSlideShow() ) {                    \
  266.         NextConfig( 1, _CONFIG_QUICK_MORPH, false );    \
  267.     }                            \
  268.     if ( GetPref( PREF_TRACK_TEXT_AUTO ) ) {        \
  269.         "_START_TRACK_TEXT"                \
  270.     }"
  271. );
  272.  
  273. // This binds code to remove any chance of track info being present after a song is over (ex, we
  274. //     want to get rid of all track text info if a song ends). 
  275. BindEvent( SS_TRACK_END_EVENT,     _KILL_TRACK_TEXT );        
  276.     
  277. // Now bind a keystroke to code that will kill any active track info and start new track info...
  278. // Recall how the ANSI C/C++ preprocessor concatenates adjacent quote-delimited strings--we take advantage of this below.
  279. BindEvent( SS_KEY_DOWN_EVENT | 'T', _KILL_TRACK_TEXT _START_TRACK_TEXT );
  280.  
  281.  
  282.  
  283.  
  284. BindEvent( SS_KEY_DOWN_EVENT | 'T' | SS_SHIFT_KEY_CODE,     "if ( GetPref( PREF_TRACK_TEXT_AUTO ) ) {                \
  285.                                     SetPref( PREF_TRACK_TEXT_AUTO, 0 );                \
  286.                                     print( \"Auto track info OFF\r\" );                \
  287.                                 }                                    \
  288.                                 else {                                    \
  289.                                     SetPref( PREF_TRACK_TEXT_AUTO, 1 );                 \
  290.                                     print( \"Auto track info ON\r\" );                \
  291.                                 }"
  292. );
  293.  
  294.  
  295.  
  296.  
  297.  
  298. BindEvent( SS_KEY_DOWN_EVENT | 'L' | SS_SHIFT_KEY_CODE,    "                \
  299.         SetPref( PREF_LINE_BOOST, ( GetPref( PREF_LINE_BOOST ) + 1 ) % 5 );      \
  300.         printf( \"Line boost: %i\n\", GetPref( PREF_LINE_BOOST ) );"
  301. );
  302.  
  303.  
  304. // This "MENU+" stuff is temporary until I implement an event binding scheme
  305. BindEvent( SS_MENU_EVENT | 1,     _TURN_SLIDESHOW_ON );
  306. BindEvent( SS_MENU_EVENT | 3,     "Grab();" );
  307. BindEvent( SS_MENU_EVENT | 5,     "Run( \"Help\" );" );
  308. BindEvent( SS_MENU_EVENT | 6,     "LaunchHelp();" );
  309. BindEvent( SS_MENU_EVENT | 8,     _TOGGLE_PIXEL_DOUBLING );
  310. BindEvent( SS_MENU_EVENT | 10,     "SetFullscreen( true );" );
  311.  
  312.  
  313. // Winamp used ZXCV keys for track navigation, so we can't use those
  314. #if WINAMP
  315.     #define _VERBOSE_KEY    SS_KEY_DOWN_EVENT | '|'
  316. #else
  317.     #define _VERBOSE_KEY    SS_KEY_DOWN_EVENT | 'V'
  318. #endif
  319.  
  320. BindEvent( _VERBOSE_KEY,     "SetVerboseMode( ! VerboseModeEnabled() );        \
  321.                 if ( VerboseModeEnabled() ) {                \
  322.                     print( \"Verbose mode ON\n\" ); }        \
  323.                 else {                            \
  324.                     print( \"Verbose mode OFF\n\" );        \
  325.                 }"
  326. );
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. // When an FFT must be performed, SetFFTParams() specifies the needed parameters (for example, when G-Force or WhiteCap is
  337. //    in stand-alone mode reading line-in audio).  Likewise, a FFT is *not* used (and these parameters are *not* used)  
  338. //    when FFT data is supplied from a host audio player (ex, iTunes, Winamp, WMP). 
  339. // The following are the arguments (in order) of SetFFTParams():
  340. //    float        mFreqLo;        // Freq of the lowest bin (in Hz)
  341. //    float        mFreqHi;        // Freq of the highest bin (in Hz)
  342. //    float        mNumPeriods;        // The number of periods to sample (for a given frequency).
  343. //    float        mMinWindow;        // The minimum number of seconds to sample for a given freq (this value will override the time implied by mNumPeriods for the given freq).
  344. //    float        mMaxWindow;        // The maximum number of seconds to sample for a given freq (this value will override the time implied by mNumPeriods for the given freq).
  345. //    long        mLinearSpacing;        // Non-zero if bin spacing is linear, otherwise spacing is log 2.
  346. SetFFTParams( 120, 4000, 6, .01, .1, false );
  347.  
  348.  
  349.  
  350.  
  351. #if STANDALONE
  352. BindEvent( SS_KEY_DOWN_EVENT | 'A' | SS_SHIFT_KEY_CODE, "                    \
  353.     if ( SetAudioSource( GetPref( PREF_AUDIO_INPUT_SOURCE ) + 1 ) == ss_NoErr ) {        \
  354.         SetPref( PREF_AUDIO_INPUT_SOURCE, GetPref( PREF_AUDIO_INPUT_SOURCE ) + 1 );    \
  355.     }                                            \
  356.     else {                                            \
  357.         SetAudioSource( 0 );                                \
  358.         SetPref( PREF_AUDIO_INPUT_SOURCE, 0 );                        \
  359.     }                                            \
  360.     printf( \"Audio input: %s\n\", GetAudioSourceDesc() );"
  361. );
  362.  
  363.  
  364.  
  365.  
  366. // Apply our audio source pref (otherwise, we'll never get audio input).  Keep in mind that
  367. //    this fcn does do anything if we're not in standalone mode.  If we get an error while
  368. //    trying to select a particular audio source, go back, use the default input.
  369. if ( SetAudioSource( GetPref( PREF_AUDIO_INPUT_SOURCE ) ) != ss_NoErr ) {
  370.     print( "Error opening preferred audio input device.\n" );
  371. }
  372. #endif
  373.  
  374.  
  375.  
  376.